import request from "@/utils/request";
import requestMd5 from "@/utils/requestMd5";

export function order_index(params) {
  return request({
    url: "/order/index",
    method: "get",
    params
  });
}

export function member_getMembers(params) {
  return request({
    url: "/member/getMembers",
    method: "get",
    params
  });
}
export function getUserPriceList(data) {
  return request({
    url: "/order/getUserPriceList",
    method: "post",
    data
  });
}

// 获取商品最近价格 
export function getGoodsLatestPrice(data) {
  return request({
    url: "/goods/getGoodsLatestPrice",
    method: "post",
    data
  });
}

// 用户订单标签
export function getMemberLabel(params) {
  return request({
    url: "/orderLabel/memberLabel",
    method: "get",
    params
  });
}

// 获取商品销售价格
export function getGoodsBuyPrice(data) {
  return request({
    url: "/goods/getGoodsBuyPrice",
    method: "post",
    data
  });
}

export function getMembersForOrder(params) {
  return request({
    url: "/member/getMembersForOrder",
    method: "get",
    params
  });
}

export function order_base(params) {
  return request({
    url: "/order/base",
    method: "get",
    params
  });
}
// 批量取消订单
export function batchCancelOrder(data) {
  return request({
    url: "/order/batchCancelOrder",
    method: "post",
    data
  })
}

// 订单拆分-订单商品列表
export function getOrderSplitList(params) {
  return request({
    url: "/orderList/getOrderList",
    method: "get",
    params
  });
}

// 订单拆分-按商品
export function splitByGoods(data) {
  return request({
    url: "/order/splitByGoods",
    method: "post",
    data
  });
}

// 快速入单
export function fast_temporary_info(params) {
  return request({
    url: "/FastAddOrde/temporary_info",
    method: "get",
    params
  });
}
// 快速入单添加
export function fast_order_add(data) {
  return request({
    url: "/FastAddOrde/fast_add",
    method: "post",
    data: data
  });
}

export function order_getMemberInfo(params) {
  return request({
    url: "/order/getMemberInfo",
    method: "get",
    params
  });
}

export function getMemberInfo(params) {
  return requestMd5({
    url: "/order/getMemberInfo",
    method: "get",
    params
  });
}

export function order_copyList(params) {
  return request({
    url: "/order/copyList",
    method: "get",
    params
  });
}

export function order_add(data) {
  return request({
    url: "/order/add",
    method: "post",
    data: data
  });
}

export function order_edit(data) {
  return request({
    url: "/order/edit",
    method: "post",
    data: data
  });
}

export function orderList_delete(data) {
  return request({
    url: "/orderList/delete",
    method: "post",
    data: data
  });
}

export function order_info(params) {
  return request({
    url: "/order/info",
    method: "get",
    params
  });
}

export function order_splitCate(params) {
  return request({
    url: "/order/splitCate",
    method: "get",
    params
  });
}

export function order_split(data) {
  return request({
    url: "/order/split",
    method: "post",
    data: data
  });
}

export function order_merge(data) {
  return request({
    url: "/order/merge",
    method: "post",
    data: data
  });
}
export function order_batchReceive(data) {
  return request({
    url: "/order/batchReceive",
    method: "post",
    data: data
  });
}

export function order_checkOrder(data) {
  return request({
    url: "/order/checkOrder",
    method: "post",
    data: data
  });
}

export function order_setOrderStatus(data) {
  return request({
    url: "/order/setOrderStatus",
    method: "post",
    data: data
  });
}

export function order_getOrderList(params) {
  return request({
    url: "/order/getOrderList",
    method: "get",
    params
  });
}

export function goods_getOfferPrice(data) {
  return request({
    url: "/goods/getOfferPrice",
    method: "post",
    data: data
  });
}


export function getOfferPrice(data) {
  return requestMd5({
    url: "/goods/getOfferPrice",
    method: "post",
    data: data
  });
}

/* 订单导出接口 */
export function order_export_info(data) {
  return request({
    url: "/export/exports_info",
    method: "get",
    data
  });
}

export function exports_list(data) {
  return request({
    url: "/export/exports_list",
    method: "post",
    responseType: "blob",
    data
  });
}



export function order_export(params) {
  return request({
    url: "/export/exports",
    method: "post",
    responseType: "blob",
    params
  });
}

/* 订单导入---开始 */
export function order_down_tem(params) {
  return request({
    url: "/export/order_import_model",
    method: "post",
    responseType: "blob",
    params
  });
}

/* 订单导入---结束 */
// 查看订单导出
export function order_info_detail(params) {
  return request({
    url: "/export/export_order_info",
    method: "post",
    responseType: "blob",
    params
  });
}

/* 打印模块获取数据 */
// 订单打印
export function order_print(data) {
  return request({
    url: "template/order_list",
    method: "post",
    data
  });
}

// 按批次打印
export function orderPrint(data) {
  return request({
    url: "template/orderPrint",
    method: "post",
    data
  });
}

// 历史打印
export function historyPrint(params) {
  return request({
    url: "template/historyPrint",
    method: "get",
    params
  })
}

// 采购单打印
export function purchase_print(data) {
  return request({
    url: "template/purchase_list",
    method: "post",
    data
  });
}
// 入库单打印
export function storage_print(data) {
  return request({
    url: "template/storage_list",
    method: "post",
    data
  });
}
// 出库打印
export function stockout_print(data) {
  return request({
    url: "template/stockOutTemplate",
    method: "post",
    data
  });
}

// 退货单打印
export function purchase_return_print(data) {
  return request({
    url: "template/purchase_list_return",
    method: "post",
    data
  });
}

// 拣货单

export function sort_print(data) {
  return request({
    url: "template/sorting_list",
    method: "post",
    data
  });
}

// 商户对账

export function statement_print(data) {
  return request({
    url: "template/statement_list",
    method: "post",
    data
  });
}

// 采购对账

export function account_list_print(data) {
  return request({
    url: "template/account_list",
    method: "post",
    data
  });
}

// 采购结算

export function advice_list_print(data) {
  return request({
    url: "template/advice_list",
    method: "post",
    data
  });
}

// 分拣小票
export function sort_note_print(data) {
  return request({
    url: "template/sorting_googs",
    method: "post",
    data: data
  });
}

// 拣货单  商户分拣
export function sort_user_print(data) {
  return request({
    url: "template/sorting_one",
    method: "post",
    data: data
  });
}

// 货到付款账单---订单---打印
export function cash_delivery_order_print(data) {
  return request({
    url: "/template/offline_list",
    method: "post",
    data
  });
}
// 在线支付账单---订单---打印
export function online_payment_order_print(data) {
  return request({
    url: "/template/online_list",
    method: "post",
    data
  });
}

// 订单退货单---打印
export function order_return_print(data) {
  return request({
    url: "/template/order_return",
    method: "post",
    data
  });
}

//文字识别
export function text_identify(data) {
  return request({
    url: "/intelligence_distinguish",
    method: "post",
    data
  });
}
//模糊识别
export function vague_search(data) {
  return request({
    url: "/vague_search",
    method: "post",
    data
  });
}

// 下载模板
export function identity_export_template(params) {
  return requestMd5({
    url: "/member/export_distinguish",
    method: "post",
    responseType: "blob",
    params
  });
}


export function getUsedGoods(data) {
  return requestMd5({
    url: "/member/commonly_goods",
    method: "post",
    data
  });
}

export function export_send_info(data) {
  return requestMd5({
    url: "/order/export_send_info",
    method: "post",
    responseType: "blob",
    data
  });
}

// 批量添加商品获取商品spu列表
export function goodsGetGoodsSpuList(params) {
  return request({
    url: "/goods/getGoodsSpuList",
    method: "get",
    params
  });
}

// 通过商品分类和商品名称搜索商品列表(可做二级规格，参考订单管理-新增订单-批量添加功能)
export function getShopList(data) {
  return requestMd5({
    url: "/goods/getCommonList",
    method: "get",
    data
  });
}



// 上传图片
export const upload_images = process.env.VUE_APP_BASE_API + "/get_content";
